package com.aconcagua.beans {
  import com.aconcagua.factory.BeanFactory;

  public class BeanList implements ValueHolder {
    private var _definitionsList: Array;

    public function BeanList(list: Array = null) {
      _definitionsList = list;
    }

    public function getValue(factory:BeanFactory): Object {
      var beansList: Array = null;

      if (_definitionsList != null) {
        beansList = new Array();
        
        var ref: Ref = new Ref();
        for each (var definition: BeanDefinitionFactory in _definitionsList) {
          ref.ref = definition;
          beansList.push(ref.getValue(factory));
        }
      }
      
      return beansList;
    }
  }
}